package com.atguigu.lease.common.exception;

import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//自定义的异常类
@AllArgsConstructor
@NoArgsConstructor
@Data
public class LeaseException extends RuntimeException{

    private Integer code;
    private String message;

    public LeaseException(ResultCodeEnum resultCodeEnum){
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }

}
